home *** CD-ROM | disk | FTP | other *** search
/ 17 Bit Software 6: Level 6 / 17 Bit - Level 6 (1998)(Epic Marketing)[!].iso / quartz / q0052.dms / q0052.adf / SOURCES / STReplayV2.4.S < prev   
Text File  |  1991-06-28  |  8KB  |  419 lines

  1. ;-----------------------------------------------------------------------;
  2. ;            SOUNDTRACKER V2.4 REPLAYER            ;
  3. ;CONSISTS OF:                                ;
  4. ;ONE ST-REPLAY-ROUTINE                            ;
  5. ;    THIS PROGRAMM WAS FIXED ON 13/04/91 BY MR.BASE/FLASHING BYTES    ;
  6. ;              © 1991 BY FLASHING BYTES DEVELOPMENTS.        ;
  7. ;         THIS SOURCECODE IS ONLY FOR TFB-MEMBERS!        ;
  8. ;-----------------------------------------------------------------------;
  9.  
  10. ;-------------------------------NACHLADEN--------------------------------
  11. >EXTERN "DF1:MODULES/ST/MOD.CLASSIC",MT_DATA
  12.  
  13. ;-------------------------BEGINN DES PROGRAMMES--------------------------
  14. start:    MOVEM.L    D0-D7/A0-A6,-(A7)
  15.     MOVE.B    #02,$BFE001
  16.     move.l     $6c,oldirq+2        ;IRQ starten (Level 3)
  17.     move.l     #newirq,$6c
  18.     jsr      mt_init
  19. Wait:    btst    #6,$bfe001
  20.     bne.s    wait
  21.     jsr       mt_end
  22.     move.l     oldirq+2,$6c        ;Alten IRQ restaurieren
  23.     moveq      #0,d0
  24.     sub.l      a0,a0    
  25.     sub.l     a1,a1
  26.     MOVE.B    #00,$BFE001
  27.     MOVEM.L    (A7)+,D0-D7/A0-A6
  28.     rts
  29.  
  30. ;-------------------------------EIGENER IRQ------------------------------
  31. newirq:    movem.l    d0-d7/a0-a6,-(sp)
  32.     jsr    mt_music
  33.     movem.l    (sp)+,d0-d7/a0-a6
  34. oldirq:    jmp     $0
  35.  
  36. ;--------------------------MUSIK INITIALISIEREN--------------------------
  37. mt_init:lea    mt_data,a0
  38.     add.l    #$03b8,a0
  39.     moveq    #$7f,d0
  40.     moveq    #0,d1
  41. mt_init1:
  42.     move.l    d1,d2
  43.     subq.w    #1,d0
  44. mt_init2:
  45.     move.b    (a0)+,d1
  46.     cmp.b    d2,d1
  47.     bgt.s    mt_init1
  48.     dbf    d0,mt_init2
  49.     addq.b    #1,d2
  50. mt_init3:
  51.     lea    mt_data,a0
  52.     lea    mt_sample1(pc),a1
  53.     asl.l    #8,d2
  54.     asl.l    #2,d2
  55.     add.l    #$438,d2
  56.     add.l    a0,d2
  57.     moveq    #$1e,d0
  58. mt_init4:
  59.     move.l    d2,(a1)+
  60.     moveq    #0,d1
  61.     move.w    42(a0),d1
  62.     asl.l    #1,d1
  63.     add.l    d1,d2
  64.     add.l    #$1e,a0
  65.     dbf    d0,mt_init4
  66.     lea    mt_sample1(PC),a0
  67.     moveq    #0,d0
  68. mt_clear:
  69.     move.l    (a0,d0.w),a1
  70.     clr.l    (a1)
  71.     addq.w    #4,d0
  72.     cmp.w    #$7c,d0
  73.     bne.s    mt_clear
  74.     clr.w    $dff0a8
  75.     clr.w    $dff0b8
  76.     clr.w    $dff0c8
  77.     clr.w    $dff0d8
  78.     clr.l    mt_partnrplay
  79.     clr.l    mt_partnote
  80.     clr.l    mt_partpoint
  81.     move.b    mt_data+$3b6,mt_maxpart+1
  82.     rts
  83.  
  84. ;----------------------------MUSIK AUSSCHLALTEN--------------------------
  85. mt_end:    clr.w    $dff0a8
  86.     clr.w    $dff0b8
  87.     clr.w    $dff0c8
  88.     clr.w    $dff0d8
  89.     move.w    #$f,$dff096
  90.     rts
  91.  
  92. ;------------------------------MUSIK ABSPIELEN---------------------------
  93. mt_music:
  94.     addq.w    #1,mt_counter
  95. mt_cool:cmp.w    #6,mt_counter
  96.     bne.s    mt_notsix
  97.     clr.w    mt_counter
  98.     bra    mt_rout2
  99. mt_notsix:
  100.     lea    mt_aud1temp(PC),a6
  101.     tst.b    3(a6)
  102.     beq.s    mt_arp1
  103.     lea    $dff0a0,a5        
  104.     bsr.s    mt_arprout
  105. mt_arp1:lea    mt_aud2temp(PC),a6
  106.     tst.b    3(a6)
  107.     beq.s    mt_arp2
  108.     lea    $dff0b0,a5
  109.     bsr.s    mt_arprout
  110. mt_arp2:lea    mt_aud3temp(PC),a6
  111.     tst.b    3(a6)
  112.     beq.s    mt_arp3
  113.     lea    $dff0c0,a5
  114.     bsr.s    mt_arprout
  115. mt_arp3:lea    mt_aud4temp(PC),a6
  116.     tst.b    3(a6)
  117.     beq.s    mt_arp4
  118.     lea    $dff0d0,a5
  119.     bra.s    mt_arprout
  120. mt_arp4:rts
  121. mt_arprout:
  122.     move.b    2(a6),d0
  123.     and.b    #$0f,d0
  124.     tst.b    d0
  125.     beq    mt_arpegrt
  126.     cmp.b    #$01,d0
  127.     beq.s    mt_portup
  128.     cmp.b    #$02,d0
  129.     beq.s    mt_portdwn
  130.     cmp.b    #$0a,d0
  131.     beq.s    mt_volslide
  132.     rts
  133. mt_portup:
  134.     moveq    #0,d0
  135.     move.b    3(a6),d0
  136.     sub.w    d0,22(a6)
  137.     cmp.w    #$71,22(a6)
  138.     bpl.s    mt_ok1
  139.     move.w    #$71,22(a6)
  140. mt_ok1:    move.w    22(a6),6(a5)
  141.     rts
  142. mt_portdwn:
  143.     moveq    #0,d0
  144.     move.b    3(a6),d0
  145.     add.w    d0,22(a6)
  146.     cmp.w    #$538,22(a6)
  147.     bmi.s    mt_ok2
  148.     move.w    #$538,22(a6)
  149. mt_ok2:    move.w    22(a6),6(a5)
  150.     rts
  151. mt_volslide:
  152.     moveq    #0,d0
  153.     move.b    3(a6),d0
  154.     lsr.b    #4,d0
  155.     tst.b    d0
  156.     beq.s    mt_voldwn
  157.     add.w    d0,18(a6)
  158.     cmp.w    #64,18(a6)
  159.     bmi.s    mt_ok3
  160.     move.w    #64,18(a6)
  161. mt_ok3:    move.w    18(a6),8(a5)
  162.     rts
  163. mt_voldwn:
  164.     moveq    #0,d0
  165.     move.b    3(a6),d0
  166.     and.b    #$0f,d0
  167.     sub.w    d0,18(a6)
  168.     bpl.s    mt_ok4
  169.     clr.w    18(a6)
  170. mt_ok4:    move.w    18(a6),8(a5)
  171.     rts
  172. mt_arpegrt:
  173.     move.w    mt_counter(PC),d0
  174.     cmp.w    #1,d0
  175.     beq.s    mt_loop2
  176.     cmp.w    #2,d0
  177.     beq.s    mt_loop3
  178.     cmp.w    #3,d0
  179.     beq.s    mt_loop4
  180.     cmp.w    #4,d0
  181.     beq.s    mt_loop2
  182.     cmp.w    #5,d0
  183.     beq.s    mt_loop3
  184.     rts
  185. mt_loop2:
  186.     moveq    #0,d0
  187.     move.b    3(a6),d0
  188.     lsr.b    #4,d0
  189.     bra.s    mt_cont
  190. mt_loop3:
  191.     moveq    #$00,d0
  192.     move.b    3(a6),d0
  193.     and.b    #$0f,d0
  194.     bra.s    mt_cont
  195. mt_loop4:
  196.     move.w    16(a6),d2
  197.     bra.s    mt_endpart
  198. mt_cont:
  199.     add.w    d0,d0
  200.     moveq    #0,d1
  201.     move.w    16(a6),d1
  202.     and.w    #$fff,d1
  203.     lea    mt_arpeggio(PC),a0
  204. mt_loop5:
  205.     move.w    (a0,d0),d2
  206.     cmp.w    (a0),d1
  207.     beq.s    mt_endpart
  208.     addq.l    #2,a0
  209.     bra.s    mt_loop5
  210. mt_endpart:
  211.     move.w    d2,6(a5)
  212.     rts
  213. mt_rout2:
  214.     lea    mt_data,a0
  215.     move.l    a0,a3
  216.     add.l    #$0c,a3
  217.     move.l    a0,a2
  218.     add.l    #$3b8,a2
  219.     add.l    #$43c,a0
  220.     move.l    mt_partnrplay(PC),d0
  221.     moveq    #0,d1
  222.     move.b    (a2,d0),d1
  223.     asl.l    #8,d1
  224.     asl.l    #2,d1
  225.     add.l    mt_partnote(PC),d1
  226.     move.l    d1,mt_partpoint
  227.     clr.w    mt_dmacon
  228.     lea    $dff0a0,a5
  229.     lea    mt_aud1temp(PC),a6
  230.     bsr    mt_playit
  231.     lea    $dff0b0,a5
  232.     lea    mt_aud2temp(PC),a6
  233.     bsr    mt_playit
  234.     lea    $dff0c0,a5
  235.     lea    mt_aud3temp(PC),a6
  236.     bsr    mt_playit
  237.     lea    $dff0d0,a5
  238.     lea    mt_aud4temp(PC),a6
  239.     bsr    mt_playit
  240.     move.w    #$01f4,d0
  241. mt_rls:    dbf    d0,mt_rls
  242.     move.w    #$8000,d0
  243.     or.w    mt_dmacon,d0
  244.     move.w    d0,$dff096
  245.     lea    mt_aud4temp(PC),a6
  246.     cmp.w    #1,14(a6)
  247.     bne.s    mt_voice3
  248.     move.l    10(a6),$dff0d0
  249.     move.w    #1,$dff0d4
  250. mt_voice3:
  251.     lea    mt_aud3temp(PC),a6
  252.     cmp.w    #1,14(a6)
  253.     bne.s    mt_voice2
  254.     move.l    10(a6),$dff0c0
  255.     move.w    #1,$dff0c4
  256. mt_voice2:
  257.     lea    mt_aud2temp(PC),a6
  258.     cmp.w    #1,14(a6)
  259.     bne.s    mt_voice1
  260.     move.l    10(a6),$dff0b0
  261.     move.w    #1,$dff0b4
  262. mt_voice1:
  263.     lea    mt_aud1temp(PC),a6
  264.     cmp.w    #1,14(a6)
  265.     bne.s    mt_voice0
  266.     move.l    10(a6),$dff0a0
  267.     move.w    #1,$dff0a4
  268. mt_voice0:
  269.     move.l    mt_partnote(PC),d0
  270.     add.l    #$10,d0
  271.     move.l    d0,mt_partnote
  272.     cmp.l    #$400,d0
  273.     bne.s    mt_stop
  274. mt_higher:
  275.     clr.l    mt_partnote
  276.     addq.l    #1,mt_partnrplay
  277.     moveq    #0,d0
  278.     move.w    mt_maxpart(PC),d0
  279.     move.l    mt_partnrplay(PC),d1
  280.     cmp.l    d0,d1
  281.     bne.s    mt_stop
  282.     clr.l    mt_partnrplay
  283. mt_stop:tst.w    mt_status
  284.     beq.s    mt_stop2
  285.     clr.w    mt_status
  286.     bra.s    mt_higher
  287. mt_stop2:
  288.     rts
  289. mt_playit:
  290.     move.l    (a0,d1.l),(a6)
  291.     addq.l    #4,d1
  292.     moveq    #0,d2
  293.     move.b    2(a6),d2
  294.     and.b    #$f0,d2
  295.     lsr.b    #4,d2
  296.     move.b    (a6),d0
  297.     and.b    #$f0,d0
  298.     or.b    d0,d2
  299.     tst.b    d2
  300.     beq.s    mt_nosamplechange
  301.     moveq    #0,d3
  302.     lea    mt_samples(PC),a1
  303.     move.l    d2,d4
  304.     asl.l    #2,d2
  305.     mulu    #$1e,d4
  306.     move.l    (a1,d2),4(a6)
  307.     move.w    (a3,d4.l),8(a6)
  308.     move.w    2(a3,d4.l),18(a6)
  309.     move.w    4(a3,d4.l),d3
  310.     tst.w    d3
  311.     beq.s    mt_displace
  312.     move.l    4(a6),d2
  313.     add.l    d3,d2
  314.     move.l    d2,4(a6)
  315.     move.l    d2,10(a6)
  316.     move.w    6(a3,d4.l),8(a6)
  317.     move.w    6(a3,d4.l),14(a6)
  318.     move.w    18(a6),8(a5)
  319.     bra.s    mt_nosamplechange
  320. mt_displace:
  321.     move.l    4(a6),d2
  322.     add.l    d3,d2
  323.     move.l    d2,10(a6)
  324.     move.w    6(a3,d4.l),14(a6)
  325.     move.w    18(a6),8(a5)
  326. mt_nosamplechange:
  327.     move.w    (a6),d0
  328.     and.w    #$fff,d0
  329.     tst.w    d0
  330.     beq.s    mt_retrout
  331.     move.w    (a6),16(a6)
  332.     move.w    20(a6),$dff096
  333.     move.l    4(a6),(a5)
  334.     move.w    8(a6),4(a5)
  335.     move.w    (a6),d0
  336.     and.w    #$fff,d0
  337.     move.w    d0,6(a5)
  338.     move.w    20(a6),d0
  339.     or.w    d0,mt_dmacon
  340. mt_retrout:
  341.     tst.w    (a6)
  342.     beq.s    mt_nonewper
  343.     move.w    (a6),22(a6)
  344. mt_nonewper:
  345.     move.b    2(a6),d0
  346.     and.b    #$0f,d0
  347.     cmp.b    #$0b,d0
  348.     beq.s    mt_posjmp
  349.     cmp.b    #$0c,d0
  350.     beq.s    mt_setvol
  351.     cmp.b    #$0d,d0
  352.     beq.s    mt_break
  353.     cmp.b    #$0e,d0
  354.     beq.s    mt_setfil
  355.     cmp.b    #$0f,d0
  356.     beq.s    mt_setspeed
  357.     rts
  358. mt_posjmp:
  359.     not.w    mt_status
  360.     moveq    #0,d0
  361.     move.b    3(a6),d0
  362.     subq.b    #1,d0
  363.     move.l    d0,mt_partnrplay
  364.     rts
  365. mt_setvol:
  366.     move.b    3(a6),8(a5)
  367.     rts
  368. mt_break:
  369.     not.w    mt_status
  370.     rts
  371. mt_setfil:
  372.     moveq    #0,d0
  373.     move.b    3(a6),d0
  374.     and.b    #1,d0
  375.     rol.b    #1,d0
  376.     and.b    #$fd,$bfe001
  377.     or.b    d0,$bfe001
  378.     rts
  379. mt_setspeed:
  380.     move.b    3(a6),d0
  381.     and.b    #$0f,d0
  382.     beq.s    mt_back
  383.     clr.w    mt_counter
  384.     move.b    d0,mt_cool+3
  385. mt_back:rts
  386.  
  387. mt_aud1temp:
  388.     blk.w    10,0
  389.     dc.w    1
  390.     blk.w    2,0
  391. mt_aud2temp:
  392.     blk.w    10,0
  393.     dc.w    2
  394.     blk.w    2,0
  395. mt_aud3temp:
  396.     blk.w    10,0
  397.     dc.w    4
  398.     blk.w    2,0
  399. mt_aud4temp:
  400.     blk.w    10,0
  401.     dc.w    8
  402.     blk.w    2,0
  403. mt_partnote:    dc.l    0
  404. mt_partnrplay:    dc.l    0
  405. mt_counter:    dc.w    0
  406. mt_partpoint:    dc.l    0
  407. mt_samples:    dc.l    0
  408. mt_sample1:    blk.l    31,0
  409. mt_maxpart:    dc.w    0
  410. mt_dmacon:    dc.w    0
  411. mt_status:    dc.w    0
  412. mt_arpeggio:
  413.     dc.w $0358,$0328,$02fa,$02d0,$02a6,$0280,$025c
  414.     dc.w $023a,$021a,$01fc,$01e0,$01c5,$01ac,$0194,$017d
  415.     dc.w $0168,$0153,$0140,$012e,$011d,$010d,$00fe,$00f0
  416.     dc.w $00e2,$00d6,$00ca,$00be,$00b4,$00aa,$00a0,$0097
  417.     dc.w $008f,$0087,$007f,$0078,$0071,$0000,$0000,$0000
  418. mt_data:    blk.b    21000,0
  419.